package com.teacher.hong.service.impl;

import com.teacher.hong.dao.ScoreDao;
import com.teacher.hong.service.IScoreService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;

@Service("scoreService")
public class ScoreServiceImpl implements IScoreService {

    @Resource
    ScoreDao scoreDao;

    @Override
    public int getSumScoreByStudentId(int studentId) {
        try {
            return scoreDao.selectSumScoreByStudentId(studentId);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            return -1;
        }
    }
}
